// **********************************************************************
//
// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************

// Ice version 3.3.0

package Tracking;

public final class StopActionData implements java.lang.Cloneable
{
    public StopAction type;

    public int orderID;

    public int customerID;

    public String src;

    public String dst;

    public float weight;

    public datetime Deadline;

    public StopActionData()
    {
    }

    public StopActionData(StopAction type, int orderID, int customerID, String src, String dst, float weight, datetime Deadline)
    {
        this.type = type;
        this.orderID = orderID;
        this.customerID = customerID;
        this.src = src;
        this.dst = dst;
        this.weight = weight;
        this.Deadline = Deadline;
    }

    public boolean
    equals(java.lang.Object rhs)
    {
        if(this == rhs)
        {
            return true;
        }
        StopActionData _r = null;
        try
        {
            _r = (StopActionData)rhs;
        }
        catch(ClassCastException ex)
        {
        }

        if(_r != null)
        {
            if(type != _r.type && type != null && !type.equals(_r.type))
            {
                return false;
            }
            if(orderID != _r.orderID)
            {
                return false;
            }
            if(customerID != _r.customerID)
            {
                return false;
            }
            if(src != _r.src && src != null && !src.equals(_r.src))
            {
                return false;
            }
            if(dst != _r.dst && dst != null && !dst.equals(_r.dst))
            {
                return false;
            }
            if(weight != _r.weight)
            {
                return false;
            }
            if(Deadline != _r.Deadline && Deadline != null && !Deadline.equals(_r.Deadline))
            {
                return false;
            }

            return true;
        }

        return false;
    }

    public int
    hashCode()
    {
        int __h = 0;
        if(type != null)
        {
            __h = 5 * __h + type.hashCode();
        }
        __h = 5 * __h + orderID;
        __h = 5 * __h + customerID;
        if(src != null)
        {
            __h = 5 * __h + src.hashCode();
        }
        if(dst != null)
        {
            __h = 5 * __h + dst.hashCode();
        }
        __h = 5 * __h + java.lang.Float.floatToIntBits(weight);
        if(Deadline != null)
        {
            __h = 5 * __h + Deadline.hashCode();
        }
        return __h;
    }

    public java.lang.Object
    clone()
    {
        java.lang.Object o = null;
        try
        {
            o = super.clone();
        }
        catch(CloneNotSupportedException ex)
        {
            assert false; // impossible
        }
        return o;
    }

    public void
    __write(IceInternal.BasicStream __os)
    {
        type.__write(__os);
        __os.writeInt(orderID);
        __os.writeInt(customerID);
        __os.writeString(src);
        __os.writeString(dst);
        __os.writeFloat(weight);
        Deadline.__write(__os);
    }

    public void
    __read(IceInternal.BasicStream __is)
    {
        type = StopAction.__read(__is);
        orderID = __is.readInt();
        customerID = __is.readInt();
        src = __is.readString();
        dst = __is.readString();
        weight = __is.readFloat();
        Deadline = new datetime();
        Deadline.__read(__is);
    }
}
